<?php
include_once "ConexionBD.php";


class DeudaSQL{
    private $sql;
    function DeudaSQL() {$this->sql = ConexionBD::getInstancia();}

    public function ingresarDatos(&$obj){

        $conn = $this->sql->getConexion();

        $sql="insert into DEUDA values(nextval('deuda1_sec'), '".$obj->getRut_Empresa()."', '".$obj->getMonto()."', current_timestamp )";

        if (!pg_query( $conn , $sql )){
            //die("Error de conexion. ". pg_last_error());
            return 0;
        }
        else return 1;
        pg_close($conn);
    }


}
?>